﻿//Write a program that shows the sign (+ or -) of the product of three real numbers without calculating it. Use a sequence of if statements.

using System;
using System.Globalization;
using System.Threading;

class ShowSignOf3NumbersProduction
{
    static void Main()
    {
        Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
        int numbersCount = 3;
        int negativeNumbersCount = 0;
        for (int i = 1; i <= numbersCount; i++)
        {
            Console.Write("Enter real number {0}: ", i);
            string numberString = Console.ReadLine().Replace(",", ".");
            double number;
            while (!double.TryParse(numberString, out number))
            {
                Console.Write("Invalid number. Input number {0} again: ", i);
                numberString = Console.ReadLine().Replace(",", ".");
            }
            if (number < 0)
            {
                negativeNumbersCount++;
            }
        }
        if (negativeNumbersCount % 2 == 0)
        {
            Console.WriteLine("The sign of the product is (+)");
        }
        else
        {
            Console.WriteLine("The sign of the product is (-)");
        }
    }
}
